home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Unable to check calloc`s
- Date: Wed, 07 Feb 96 20:38:38 GMT
- Organization: none
- Message-ID: <823725518snz@genesis.demon.co.uk>
- References: <4f2l8a$c98@gail.ripco.com> <4fadmp$t6g@osage.csc.ti.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4fadmp$t6g@osage.csc.ti.com>
- ramli@sislnews.csc.ti.com "C. S. Ramalingam" writes:
-
- >When would using calloc be more appropriate than using malloc ? Is it true
- >that the only use for calloc is in initializing integral values to zero ?
- >If so, why was a new function, which appears to have very limited used,
- >introduced in the first place ?
-
- ANSI adopted it because it was widely implemented and used at the time and
- it does have some degree of usefulness. I expect calloc was introduced on
- systems where all zero bits did represent a float value of 0 and a null
- pointer. A language developing without real focus can pick up baggage
- like that.
-
- You might also ask why gets() is still a part of the language.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-